package com.fc.upload;

import com.fc.utils.AliossUtil;
import com.fc.utils.ResultVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/admin/common")
@RequiredArgsConstructor
@Tag(name = "文件上传接口")
public class AliossUpload {

    private final AliossUtil aliossUtil;

    @PostMapping("/upload")
    @Operation(summary = "文件上传")
    public ResultVO<String> upload(MultipartFile file) {
        return ResultVO.success(aliossUtil.upload(file));
    }
}
